package cn.com.qtgl.userfilters.model.entity;

import cn.com.qtgl.userfilters.model.enums.DepartmentAdapter;
import cn.com.qtgl.userfilters.model.enums.PostAdapter;
import cn.melonlib.cores.commons.model.entity.TenantRecordEntity;
import cn.melonlib.cores.model.anno.ModelComment;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

@Data
@EqualsAndHashCode(callSuper = true)
@ModelComment("UserFilter身份信息")
@Entity(name = "DbPositionItem")
@Table(name = "sec_db_position_item")
public class DbPositionItem extends TenantRecordEntity {

    @ModelComment("部门")
    private String department;

    @ModelComment("部门匹配方式")
    @Enumerated(EnumType.STRING)
    private DepartmentAdapter departmentAdapter=DepartmentAdapter.ALL;

    @ModelComment("岗位")
    private String post;

    @ModelComment("岗位匹配方式")
    @Enumerated(EnumType.STRING)
    private PostAdapter postAdapter=PostAdapter.ALL;

    @ManyToOne(cascade = {CascadeType.REFRESH},fetch = FetchType.LAZY)
    @JoinColumn(name = "userfilter_id")
    private DbUserFilter dbUserFilter;

}
